<%
Function FormatarCGCCPF(sCGCCPF, sTipo)

	If sTipo = "G" Then
	
		FormatarCGCCPF = SeparaCGC(sCGCCPF)
	
	Elseif sTipo = "F" Then
	
		FormatarCGCCPF = SeparaCPF(sCGCCPF)
	
	End If

End Function

Function SeparaCpf(sCpf)

	SeparaCpf = Left(sCpf, 3) & "." & Mid(sCpf ,4, 3) & "." & Mid(sCpf, 7, 3) & "-" & Right(sCpf, 2)
	
End Function

Function SeparaCgc(sCgc)

	SeparaCgc = Left(sCgc, 2) & "." & Mid(sCgc ,3, 3) & "." & Mid(sCgc, 6, 3) & "/" & Mid(sCgc, 9, 4) & "-" & Right(sCgc, 2)
	
End Function

%>